package com.api.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import com.api.common.jwt.TokenIgnore;
import com.api.common.reqres.Request;
import com.api.common.reqres.Response;
import com.api.model.request.IsUserMenuRequest;
import com.api.model.request.MenuListRequest;
import com.api.model.response.NullResponse;
import com.api.service.MenuService;

import io.swagger.annotations.ApiOperation;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author cfp
 * @since 2019-10-22
 */
@TokenIgnore
@RestController
public class MenuController {
	@Autowired
	private MenuService menuService;

	@ApiOperation(notes = "菜单列表", value = "菜单列表")
	@PostMapping(value = "/menuList.do")
	public Response<NullResponse> menuList(@RequestBody Request<MenuListRequest> request) throws Exception {
		return menuService.menuList(request);
	}

	@ApiOperation(notes = "菜单是否可用", value = "菜单是否可用")
	@PostMapping(value = "/isUserMenu.do")
	public Response<NullResponse> isUserMenu(@RequestBody Request<IsUserMenuRequest> request) throws Exception {
		return menuService.isUserMenu(request);
	}
}
